package com.code.day04;

import java.util.Scanner;

public class Day04_Array {
    public static void main(String[] args) {
//        //动态初始化
//      int arr[] = new int[5];
//      arr[0] = 1;
//      arr[1] = 2;
//      arr[2] = 3;
//      arr[3] = 4;
//      arr[4] = 5;
//
      String arr2[] = new String[5];

//
//       for (int i = 0; i < arr.length; i++){
//           System.out.println(arr[i]);
//       }
        System.out.println( arr2[0]);
//
//       //静态初始化
//        int[] arr3 = {1,2,3,4,5};
//        int[] arr4 = new int[]{1,2,3,4,5};
//        String[] arr5 = {"1","2","3","4","5"};
//
//        System.out.println(arr3.length);

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数组内容:");
        int[] array1 = new int[5];
        for (int i = 0; i < array1.length; i++){
            array1[i] = scanner.nextInt();
        }
        scanner.close();
        for (int i = 0; i < array1.length; i++){
            System.out.println(array1[i]);
        }

    }


}
